package com.crm.business.admin.service.impl;

import com.crm.business.admin.service.ISysLogService;
import com.crm.business.admin.service.LogService;
import com.crm.common.admin.entity.PO.LoginLog;
import com.crm.common.admin.entity.PO.SysLog;
import com.crm.common.ka.core.common.log.SysLogEntity;
import com.crm.common.ka.core.feign.admin.entity.LoginLogEntity;
import org.checkerframework.checker.units.qual.A;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LogServiceImpl implements LogService {

    @Autowired
    private ISysLogService sysLogService;

    public void saveSysLog(SysLogEntity sysLogEntity){
        SysLog sysLog = new SysLog();
        BeanUtils.copyProperties(sysLogEntity,sysLog);
        sysLogService.saveSysLog(sysLog);
    }

    public void saveLoginLog(LoginLogEntity loginLogEntity){

        LoginLog loginLog = new LoginLog();
        BeanUtils.copyProperties(loginLogEntity,loginLog);
        sysLogService.saveLoginLog(loginLog);
    }
}
